package cn.jtool.dig.server.service;

import cn.jtool.dig.server.dao.entity.PortMapping;
import cn.jtool.dig.server.domain.dto.ConnectionInfoDto;
import cn.jtool.dig.server.domain.reqeust.PortMappingParams;
import cn.jtool.dig.server.domain.reqeust.PortMappingQueryRequest;
import cn.jtool.dig.server.domain.response.PortMappingDetailResponse;
import cn.jtool.dig.server.domain.response.PortMappingListResposne;
import cn.jtool.knife.core.result.PageResultEntity;
import cn.jtool.knife.core.service.*;

public interface PortMappingService extends Create<PortMappingParams>,
        Delete<Integer>,
        Update<Integer, PortMappingParams, PortMappingDetailResponse>,
        SelectOne<Integer, PortMappingDetailResponse>,
        SelectList<PortMappingQueryRequest, PortMappingListResposne> {



    PortMapping selectBySourcePort(int port);

    /**
     * 获取隧道的连接列表
     * @param id
     * @return
     */
    PageResultEntity<ConnectionInfoDto> connectList(int id);

    /**
     * 断开连接
     * @param id
     */
    void kill(int id);

    /**
     * 禁用ip
     * @param tunnelId
     * @param id
     */
    void ban(int tunnelId, int id);
}
